package net.ewon.avatar.agent;

import javax.annotation.Resource;

import net.ewon.avatar.common.util.OSUtil;

public class AvatarPackageRepoFactory {
 
	@Resource(name="avatarPackageWinRepo")
	private AvatarPackageRepo avatarPackageWinRepo;
	
	@Resource(name="avatarPackageLinuxRepo")
	private AvatarPackageRepo avatarPackageLinuxRepo;
	 
	public AvatarPackageRepo getAvatarPackageRepo() {
		if(OSUtil.isWindows()) {
			return avatarPackageWinRepo;
		} else if(OSUtil.isMacOs() || OSUtil.isLinux()) {
			return avatarPackageLinuxRepo;
		}
		throw new RuntimeException("The repo is not found. for OS:" + OSUtil.getOsName());
	}
}
